import { defineStore } from "pinia"
import { ref } from 'vue'

export const useUserStore = defineStore('user', () => {
  const userInfo =  ref({})

  const setUserInfo = (obj) => {
     userInfo.value = obj
  }

  const removeUserInfo = () => {
    localStorage.removeItem('user')
  }
  return {
    userInfo,
    setUserInfo,
    removeUserInfo
  }
},
{
  persist: true
}
)